package charatr04.demo;
//抽象类
abstract class Student{
    int id;
    String name;
    abstract void setId(int id);
    abstract int getId();
    abstract void setName(String name);
    abstract String getName();
    public void study(){
        System.out.println("我的天职是学习");
    }

}
//1.抽象类可以直接继承抽象类
abstract class SmallStudent extends Student{}
//2.普通类继承抽象类
class SeniorStudent extends Student{
    void setId(int id){
        this.id=id;
    }
    public int getId(){
        return this.id;
    };
    void setName(String name){
        this.name = name;
    };
    public String getName(){
        return  this.name;
    };
}
public class demo3 {
    public static void main(String[] args) {
        SeniorStudent student = new SeniorStudent();
        student.id=1;
        student.name ="小明";
        student.study();
    }
}